package com.example.domain.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.time.LocalDateTime;

@TableName("room")
@Data
public class Room {
    public static final String ID = "id";
    public static final String NAME = "name";
    public static final String DESCRIPTION = "description";
    public static final String AVATAR = "avatar";
    public static final String START = "start";
    public static final String END = "end";
    public static final String STATUS = "status";
    public static final String TYPE_ID = "type_id";
    public static final String TEACHER_ID = "teacher_id";
    public static final String TYPE_NAME = "typeName";
    public static final String TEACHER_NAME = "teacherName";
    public static final String STUDENT_NAME = "studentName";
    public static final String TYPE = "type";
    public static final String SEAT_NUM = "seat_num"; // 新增字段常量
    public static final String DEVICE_SUPPORT = "device_support"; // 新增字段常量
    public static final String PRICE = "price"; // 新增字段常量

    @TableId(value = ID, type = IdType.AUTO)
    private Integer id;

    @TableField(NAME)
    private String name;

    @TableField(DESCRIPTION)
    private String description;

    @TableField(AVATAR)
    private String avatar;

    @TableField(START)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime start;

    @TableField(END)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime end;

    @TableField(STATUS)
    private Integer status;

    @TableField(TYPE_ID)
    private Integer typeId;

    @TableField(value = TEACHER_ID,updateStrategy = FieldStrategy.DEFAULT)
    private Integer teacherId;

    @TableField(exist = false)
    private String typeName;

    @TableField(exist = false)
    private String teacherName;

    @TableField(exist = false)
    private String studentName;

    @TableField(TYPE)
    private Integer type;

    @TableField(SEAT_NUM) // 新增seat_num字段
    private Integer seatNum;

    @TableField(DEVICE_SUPPORT) // 新增device字段
    private String deviceSupport;

    @TableField(PRICE) // 新增price字段
    private Double price;
}